package com.flyqiu.flow.core.handler;

import com.flyqiu.flow.api.context.ProcInstContext;
import com.flyqiu.flow.api.element.FlyQiuFlowElementManage;
import com.flyqiu.flow.api.std.ElementStartHandler;
import com.flyqiu.flow.bpmn.element.BaseProcElement;
import com.flyqiu.flow.bpmn.element.SequenceFlow;
import com.flyqiu.flow.model.entity.ru.ProcRuActivity;

public class SequenceElementHandler extends BaseProcActElementHandler<SequenceFlow, ProcRuActivity> {

    @Override
    protected void startNextActivity(ProcInstContext procContext, ProcRuActivity currentRuActivity) {
        BaseProcElement targetNode = currentElement.getTargetNode();
        FlyQiuFlowElementManage procElementConfig = procContext.getGlobalContext().getFlowElementManage();
        ElementStartHandler actInst = procElementConfig.createStartInst(targetNode.getElementType());
        actInst.start(procContext, targetNode.getDefKey());
    }
}
